package com.yungam.common.bean.team;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yungam.common.bean.user.User;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
@Accessors(chain = true)
@TableName("team")
public class Team {

    @TableId(type = IdType.AUTO)
    private Integer id;                 // id
    private String teamNo;              // 班组编号
    private String teamName;            // 班组名称
    private Integer leaderId;           // 班组组长id
    private String leaderName;          // 班组组长名称
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;            // 创建时间
    @TableField(exist = false)
    private List<User> teamMembers;     // 班组成员
    @TableField(exist = false)
    private List<Integer> memberIds;     // 班组成员id  (用于接受前端)
}
